import os.path


class Entry:
    SEPARATOR = os.path.sep

    def readClass(self, className):
        pass

    def __str__(self):
        pass

    @staticmethod
    def newEntry(path: str):
        from classpath.composite_entry import CompositeEntry
        from classpath.dir_entry import DirEntry
        from classpath.wildcard_entry import WildcardEntry
        from classpath.zip_entry import ZipEntry
        if Entry.SEPARATOR in path:
            return CompositeEntry.newCompositeEntry(path)

        if path.endswith("*"):
            return WildcardEntry.newWildcardEntry(path)

        if path.endswith(".zip") or path.endswith(".ZIP") or path.endswith(".jar") or path.endswith(".JAR"):
            return ZipEntry.newZipEntry(path)

        return DirEntry.newDirEntry(path)

